<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\models\search\CodeSearch */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="code-search">
    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
        'options' => ['class' => 'form-inline'],
        'fieldConfig' => [
            'template' => "{label}\n{input}\n",
            'labelOptions' => ['class' => 'sr-only'],
        ],
    ]); ?>

    <?= $form->field($model, 'goods_sn')->textInput(['placeholder' => '产品识别码']) ?>
    <?= $form->field($model, 'status')->dropDownList(['10' => '未使用', '20' => '已使用']) ?>
    <?= $form->field($model, 'is_receive')->dropDownList(['0' => '未导出', '1' => '已导出']) ?>

    <div class="form-group">
        <?= Html::submitButton('<i class="fa fa-search"></i>', ['class' => 'btn btn-default']) ?>
    </div>
    <div class="form-group">
        <button type="button" id="export">导出</button>
    </div>

    <?php ActiveForm::end(); ?>

</div>
</div>
<?php
$js = <<<JS
    $(function(){
        $('#export').click(function(){
            window.location.href =  window.location.href + '&CodeSearch[export]=1';
        })
    })
JS;
$this->registerJs($js);
?>
